package com.mindskip.xzs.controller.admin;

import com.mindskip.xzs.base.BaseApiController;
import com.mindskip.xzs.domain.ExamPaper;
import com.mindskip.xzs.domain.User;
import com.mindskip.xzs.service.ExamPaperService;
import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM;
import org.springframework.beans.factory.annotation.Autowired;


public class ThreadController extends BaseApiController {

    public final ExamPaperService examPaperService;
    @Autowired
    public ThreadController(ExamPaperService examPaperService) {
        this.examPaperService = examPaperService;
    }

    public String DemoThread(){
        ExamPaperEditRequestVM model = new ExamPaperEditRequestVM();
        model.setName("小张");
        User user = new User();
        user.setId(2);
        ExamPaper examPaper =  examPaperService.savePaperFromVM(model,user);
        return examPaper.getName();
    }

}
